package cn.tedu.blog.server.pojo.dto;

import cn.tedu.blog.server.pojo.vo.UserListVO;
import cn.tedu.blog.server.utils.DateUtils;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 雷茂林
 * @description: 用户表
 * @date
 */
@Data
public class UserAddNewDTO implements Serializable {

    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "账号",name = "username",example = "test")
    private String username;

    @ApiModelProperty(value = "用户密码",name = "password",example = "123456")
    private String password;

    @ApiModelProperty(value = "头像",name = "avatar",example = "无")
    private String avatar;

    @ApiModelProperty(value = "昵称",name = "nick",example = "默认测试")
    private String nick;

    @ApiModelProperty(value = "性别",name = "gender",example = "1") //默认男
    private Integer gender;

    @ApiModelProperty(value = "手机号",name = "phone",example = "12345678910")
    private String phone;

    @ApiModelProperty(value = "个性签名",name = "signature",example = "这个家伙很懒没有留下任何签名哦！")
    private String signature;

    @ApiModelProperty(value = "状态",name = "status",example = "1")
    private Integer status;

    @ApiModelProperty(value = "最后登录时间",name = "lastLogin")
    @JsonFormat(pattern = DateUtils.FORMAT_STRING,timezone="GMT+8")
    private LocalDateTime lastLogin;


    //FieldFill.INSERT：添加时自动填充实现
    @ApiModelProperty(value = "创建时间",name = "createdTime")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = DateUtils.FORMAT_STRING,timezone="GMT+8")
    private LocalDateTime createdTime;


    //FieldFill.UPDATE：修改时自动填充实现
    @ApiModelProperty(value = "修改时间",name = "gmtModified")
    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(pattern = DateUtils.FORMAT_STRING,timezone="GMT+8")
    private LocalDateTime gmtModified;


    // 给用户赋予角色的数组
    private List<Long[]> optionsSelect;
}
